package com.yunji.storage.enums;

import java.util.Objects;

public enum StockTakeStatus {
    DRAFT(0, "草稿"),
    WAIT(1, "待盘点"),
    PROCEED(2, "盘点中"),
    OVER(3, "盘点结束"),
    FINISH(4, "已完成"),
    CANCEL(5, "已取消"),
    SCRAP(6, "作废");

    private final Integer code;
    private final String text;

    StockTakeStatus(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static String get(Integer code) {
        StockTakeStatus[] enums = StockTakeStatus.values();
        for (StockTakeStatus e : enums) {
            if (Objects.equals(e.code, code)) {
                return e.text;
            }
        }
        return null;
    }

}
